package com.wangijun.yuan.web.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wangijun.yuan.core.domain.TagInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface TagInfoMapper extends BaseMapper<TagInfo> {

    @Update("update tag_info" +
            " set read_num = read_num + #{num}" +
            " where id = #{id}")
    void readNumAdd(@Param("id") Long id, @Param("num") Integer num);

   @Update("update tag_info" +
            " set follow_num = follow_num + #{num}" +
            " where id = #{id}")
    void followNumAdd(@Param("id") Long id, @Param("num") Integer num);


    @Update("update tag_info" +
            " set new_art_id = #{artId} ,new_art_title = #{artTitle} " +
            " where id = #{id}")
    void artNewTitle(@Param("id") Long id, @Param("artId") Long artId, @Param("artTitle") String artTitle);
}